<template>
    <view class="page">
        <view v-for="(item, index) in obj" :key="index">
            <text> 测试 {{ item.num }}</text>
            <button size="mini" @click="change(item, index)">改变</button>
        </view>
    </view>
</template>

<script>
export default {
    name: "test",
    props: {
        obj: Array,
        default: () => ({}),
    },
    data() {
        return {};
    },
    methods: {
        change(item, index) {
            const data = { ...item };
            data.num++;
            this.$emit("change", index,data);
        },
    },
};
</script>

<style scoped>
.page {
    border: 1px solid red;
}
</style>
